home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / monochrome.swf / scripts / frame_10 / PlaceObject2_493_495 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-08-26  |  1.5 KB  |  56 lines

  1. onClipEvent(enterFrame){
  2.    if(_name != "shipSTAT" && _currentframe == 1)
  3.    {
  4.       xspeed = speed * Math.sin((_rotation * -1 + 180) * 0.017453292519943295);
  5.       yspeed = speed * Math.cos((_rotation * -1 + 180) * 0.017453292519943295);
  6.       _rotation = Math.atan2(_X - _root.ship._x,_Y - _root.ship._y) / 0.017453292519943295 * -1;
  7.       var i = 0;
  8.       while(i <= 20)
  9.       {
  10.          if(sh.harea.hitTest(_root["hmn" + i]))
  11.          {
  12.             life -= _root["hmn" + i].dmg;
  13.             sh.play();
  14.             removeMovieClip(_root["hmn" + i]);
  15.             pp = random(6);
  16.          }
  17.          i++;
  18.       }
  19.       if(_root.ship.sh.hitTest(sh.harea) && _root.missionbox.sttc._currentframe == 1)
  20.       {
  21.          _root.ship.play();
  22.       }
  23.       if(life <= 0)
  24.       {
  25.          play();
  26.       }
  27.       if(pp == 0)
  28.       {
  29.          _root.missionbox.sttc.play();
  30.       }
  31.       if(_root.missionbox.sttc._currentframe == 28)
  32.       {
  33.          _X = random(550);
  34.          _Y = random(400);
  35.          while(Math.abs(_X - _root.ship._x) < 100 || Math.abs(_Y - _root.ship._y) < 100)
  36.          {
  37.             _X = random(550);
  38.             _Y = random(400);
  39.          }
  40.       }
  41.       pp = random(100);
  42.       if(_root.missionbox.sttc._currentframe == 1)
  43.       {
  44.          yy = random(20);
  45.          if(yy == 0 && _currentframe == 1)
  46.          {
  47.             _root.fire(this);
  48.          }
  49.       }
  50.    }
  51.    if(_root.rem == true)
  52.    {
  53.       removeMovieClip(this);
  54.    }
  55. }
  56.